import request from '@/utils/request'

// 查询bom模型列表
export function listBomCost(query) {
  return request({
    url: '/system/bomCost/list',
    method: 'get',
    params: query
  })
}

export function listBomCost2(query) {
  return request({
    url: '/system/bomCost/treeselect',
    method: 'get',
    params: query
  })
}

// 查询bom模型详细
export function getBomCost(id) {
  return request({
    url: '/system/bomCost/' + id,
    method: 'get'
  })
}

// 新增bom模型
export function addBomCost(data) {
  return request({
    url: '/system/bomCost',
    method: 'post',
    data: data
  })
}

// 修改bom模型
export function updateBomCost(data) {
  return request({
    url: '/system/bomCost',
    method: 'put',
    data: data
  })
}

// 删除bom模型
export function delBomCost(id) {
  return request({
    url: '/system/bomCost/' + id,
    method: 'delete'
  })
}

// 获取root
export function getroot(query) {
  return request({
    url: '/system/bomCost/getroot',
    method: 'get',
    params: query
  })
}

// 获取子节点
export function getchildren(query) {
  return request({
    url: '/system/bomCost/getchildren',
    method: 'get',
    params: query
  })
}
